local RoomScene = class("RoomScene",function()
	return cc.Scene:create()
end)


function RoomScene:create()
     
    local scene = RoomScene.new() 
    scene:registerScriptHandler(handler(scene, scene.onNodeEvent))

    return scene
end

function RoomScene:onNodeEvent(eventType)
    if eventType == "enter" then 
        SpriteFrameMgr:getInstance():cleanupPurgeCachedResource()
    elseif eventType == "exit" then
        cclog("RoomScene.create. exit...1")        
        self:unregisterScriptHandler();            
    elseif eventType == "enterTransitionFinish" then            
        self:initGameLayer()
    elseif eventType == "exitTransitionStart" then
        cclog("RoomScene.create. exitTransitionStart...1")        
    end
end

function RoomScene:initGameLayer()
    print "=========RoomScene:initGameLayer====================="    
    local roomLayer = require("view/Room/RoomLayer"):create()
    self:addChild(roomLayer)
end

return RoomScene;